home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-10-22 | 29.9 KB | 1,193 lines |
- : Run this shell script with "sh" not "csh"
- PATH=:/bin:/usr/bin:/usr/ucb
- export PATH
- all=FALSE
- if [ $1x = -ax ]; then
- all=TRUE
- fi
- /bin/echo 'Extracting stacknews'
- sed 's/^X//' <<'//go.sysin dd *' >stacknews
- #!/usr/bin/perl
- #
- # stacknews - create and maintain a folder stack for reading news
- #
- # This program builds a folder stack (separate from the MH folder stack)
- # of news groups to be read. It prints the path to the appropriate
- # MH context file. A separate MH context is kept for each news group.
- # This should speed up certain MH operations and avoids the problem of
- # having news group folders in your main MH context.
- #
- # Usage:
- # setenv MHCONTEXT \
- # `stacknews [-(no)check] [-(no)clear] [-(no)debug] [-(no)list]
- # [-(no)next] [-(no)push] [-(no)rigor] group ...`
- #
- # Options:
- # -check find the first group with new articles
- # -clear clear the folder stack
- # -debug turn on debugging
- # -list list the folder stack
- # -next pop the folder stack
- # -nocheck push all groups unconditionally
- # -noclear do not clear the folder stack
- # -nodebug operate in normal (non-debug) mode
- # -nolist do not list the folder stack
- # -nonext do not pop the folder stack
- # -nopush do not push groups onto the folder stack
- # -norigor use defaults or the environment ONLY
- # -push push groups onto the folder stack
- # -rigor check the MH profile (the usual MH stuff)
- #
- # Defaults: -check -noclear -nodebug -nonext -push -rigor
- #
- # Any groups on the command line are pushed onto the stack.
- # If no groups are specified, then all default groups are
- # pushed onto the stack.
- #
- # Mutually exclusive options: -clear, -list, -next, -push
- #
- # Some useful code to include in your .cshrc file:
- #
- # if (! $?stacknews) then
- # set stacknews = "stacknews"
- # endif
- # alias sninvo 'setenv MHCONTEXT `$stacknews \!*`'
- # alias news 'set stacknews = "stacknews" ; sninvo'
- # alias fnews 'set stacknews = "stacknews.f" ; sninvo'
- # alias g 'setenv MHCONTEXT `$stacknews -next \!*`'
- # alias q 'folder -fast last > /dev/null ; g'
- # alias u 'setenv MHCONTEXT `$stacknews -nopush \!*`'
- # alias z '$stacknews -clear \!*; unsetenv MHCONTEXT'
- # alias nglist '$stacknews -list \!*'
- #
- # The code above defines the following commands:
- # g -- Go to the next news group.
- # news -- Read new news groups.
- # nglist -- See the current state of the news stack.
- # q -- Set the last article to be the current article
- # -- and go to the next news group.
- # sninvo -- Utility alias to invoke stacknews.
- # u -- Set ("update") another shell's MHCONTEXT ...
- # but unfortunately doesn't handle the case
- # of an alternative set of news groups, e.g.
- # as read by stacknews.f
- # z -- Stop reading news altogether.
- #
- #
- # Environment variables:
- # HOME path of home directory
- # MH path of MH profile file
- # MHCONTEXT path of current MH context file
- # NEWSARTS path of top directory containing news articles
- # NEWSCONTEXTS path of directory containing folder contexts
- # NEWSGROUPS list of colon-separated news groups to read
- #
- # MH profile components:
- # context path of MH context file
- # path path of MH directory
- # (prog) default options
- # (prog)-arts path of top directory containing news articles
- # (prog)-contexts path of directory containing folder contexts
- # (prog)-defaults path of file containing list of news groups
- # (prog)-groups list of comma-separated news groups to read
- #
- # Note: "(prog)" above is the invocation name of the program;
- # MH profile components might be named stacknews-defaults,
- # stacknews-groups, and stacknews-arts, if the program is invoked
- # as "stacknews".
- #
- # Files and Directories:
- # $HOME/.mh_profile default MH profile
- # $HOME/.news-contexts default news folder contexts directory
- # $HOME/.news-contexts/Stack news folder stack
- # $HOME/.news-defaults list of default news groups
- # $HOME/Mail default MH directory
- # $HOME/Mail/context default MH context file
- #
- # Author: Jerry Sweet <jns@fernwood.mpk.ca.us>
- # Taken from my old, similar, but much slower, "news" program.
- #
- # $Header: /q2/uh/jsweet/src/mh-front/RCS/stacknews,v 1.6 1992/06/11 18:24:52 jsweet Exp $
-
- #
- # Subprograms
- #
-
- sub relative_to_absolute {
- local($_) = @_;
-
- if ($_ !~ /^\//) {
- $_ = sprintf("%s%s%s", $mhroot, $_ ? '/' : '', $_);
- }
- if ($_ !~ /^\//) {
- $_ = sprintf("%s/%s", $ENV{'HOME'}, $_);
- }
- $_;
- }
-
- sub destroy_cur {
- local($dir) = @_;
- local($sequence_file) = "$dir/.mh_sequences";
-
- unlink $sequence_file if ($update_cur && -e $sequence_file);
- # This is the only known way (in MH 6.6 at least) to reset cur if new
- # messages have arrived in a folder (via rcvstore) after all messages
- # were removed or refiled.
- }
-
- #
- # Main
- #
-
- umask 077; # This should be adjustable, but isn't at the moment.
-
- ($prog = $0) =~ s%.*/%%;
-
- $newsarts = defined $ENV{'NEWSARTS'} ? $ENV{'NEWSARTS'} : '/usr/spool/news';
- $HOME = $ENV{'HOME'} ;
- $profile = defined $ENV{'MH'} ? $ENV{'MH'} : "$HOME/.mh_profile";
- $mhroot = "$HOME/Mail";
- if (defined $ENV{'NEWSGROUPS'}) {
- @groups = split(/:/, $ENV{'NEWSGROUPS'});
- }
- $contexts = defined $ENV{'NEWSCONTEXTS'} ?
- $ENV{'NEWSCONTEXTS'} :
- "$HOME/.news-contexts";
- $mhcontext = defined $ENV{'MHCONTEXT'} ?
- $ENV{'MHCONTEXT'} :
- "$mhroot/context";
-
- $check_folders = 1;
- $rigor = 1;
- $push = 1;
-
- # Look for the -norigor option in the command line.
-
- while ($_ = shift @ARGV) {
- push(@Args, $_);
- /^-norigor$/ && $rigor--;
- /^-rigor$/ && $rigor++;
- }
-
- if ($rigor > 0) {
- $ndfile = -e "$HOME/.news-defaults" ? "$HOME/.news-defaults" : '';
-
- $profile_component = 'x-bogus';
-
- if (! open(PROFILE, "<$profile")) {
- print STDERR "$prog: can't open profile \"$profile\" - $!\n";
- }
- else {
- while (<PROFILE>) {
- /^(\S+):\s*/ && do {
- ($profile_component = $1) =~ tr/A-Z/a-z/;
- $PROFILE_COMPONENT{$profile_component} = $';
- };
-
- /^[ \t]/ && do {
- $PROFILE_COMPONENT{$profile_component} .= $_;
- };
- }
-
- if (defined $PROFILE_COMPONENT{'path'}) {
- $_ = $PROFILE_COMPONENT{'path'};
- /^\s*(\S+)/ && do { $mhroot = $1; };
- }
- if (defined $PROFILE_COMPONENT{'context'}) {
- $_ = $PROFILE_COMPONENT{'context'};
- /^\s*(\S+)/ && do {
- $mhcontext = $1;
- if ($mhcontext !~ /^\//) {
- $mhcontext = "$mhroot/$mhcontext";
- }
- };
- }
- if (defined $PROFILE_COMPONENT{$prog}) {
- $_ = $PROFILE_COMPONENT{$prog};
- @Args = (split, @Args);
- }
- if (defined $PROFILE_COMPONENT{"$prog-arts"}) {
- $_ = $PROFILE_COMPONENT{"$prog-arts"};
- /^\s*(\S+)/ && do { $newsarts = $1; };
- }
- if (defined $PROFILE_COMPONENT{"$prog-contexts"}) {
- $_ = $PROFILE_COMPONENT{"$prog-contexts"};
- /^\s*(\S+)/ && do {
- $contexts = $1;
- if ($contexts !~ /^\//) {
- $contexts = "$mhroot/$contexts";
- }
- };
- }
- if (defined $PROFILE_COMPONENT{"$prog-defaults"}) {
- $_ = $PROFILE_COMPONENT{"$prog-defaults"};
- /^\s*(\S+)/ && do {
- $ndfile = $1;
- if ($contexts !~ /^\//) {
- $contexts = "$mhroot/$contexts";
- }
- };
- }
- if (defined $PROFILE_COMPONENT{"$prog-groups"}) {
- $_ = $PROFILE_COMPONENT{"$prog-groups"};
- @profile_groups = split(/\s*,\s*/);
- }
- }
- }
-
- # Evaluate the switches:
-
- while ($_ = shift @Args) {
- /^-check$/ && $check_folders++;
- /^-clear$/ && $clear_stack++;
- /^-debug$/ && $debug++;
- /^-list$/ && $list++;
- /^-next$/ && $next++;
- /^-nocheck$/ && $check_folders--;
- /^-noclear$/ && $clear_stack--;
- /^-nodebug$/ && $debug--;
- /^-nolist$/ && $list--;
- /^-nonext$/ && $next--;
- /^-nopush$/ && $push--;
- /^-push$/ && $push++;
- /^[^-]/ && push(@switch_groups, $_);
- }
-
- if (! -d $contexts) {
- if (! mkdir($contexts, 0700)) {
- print STDERR "$prog: can't mkdir \"$contexts\" - $!\n";
- exit 1;
- }
- }
-
-
- $folder_stack = "$contexts/Stack";
-
- if ($clear_stack > 0) {
- @groups = ();
- }
- else {
- # Read the folder stack:
-
- if (-e $folder_stack) {
- if (! open(STACK, "<$folder_stack")) {
- print STDERR
- "$prog: can't open folder stack file \"$folder_stack\" - $!\n";
- print "$mhcontext\n" unless ! $print_context;
- exit 1;
- }
- foreach (<STACK>) {
- next if /^#|^\s*$/;
- push(@stack, split);
- }
- }
-
- if ($list > 0) {
- foreach (@stack) {
- push(@group_list, $_);
- }
-
- if ($#group_list >= 0) {
- print STDERR join(' ', @group_list), "\n";
- }
- exit 0;
- }
- }
-
- shift(@stack) if ($next > 0); # If we saw -next, then pop the stack.
-
- if ($clear_stack <= 0 && $next <= 0 && $push > 0) {
- # Decide on the news groups at which to look:
-
- if ($#switch_groups < 0 && $#profile_groups >= 0) {
- push(@groups, @profile_groups);
- # Select groups from the (prog)-groups: component.
- }
-
- if ($#groups < 0 && $#switch_groups < 0 && $ndfile) {
- # Look at the .news-defaults file:
-
- if (! open(NDFILE, $ndfile)) {
- print STDERR "$prog: can't open news defaults file \"$ndfile\" - $!\n";
- print "$mhcontext\n" unless ! $print_context;
- exit 1;
- }
-
- while (<NDFILE>) {
- next if /^#|^\s*$/;
- split;
- push(@groups, @_);
- }
- }
-
- # Push news groups onto the folder stack:
-
- push(@stack, @groups);
-
- # Push groups from the command line onto the front of the stack:
-
- foreach (reverse(@switch_groups)) {
- unshift(@stack, $_);
- }
- }
-
- if ($clear_stack <= 0 && $push > 0) {
- # Find the first group for which new articles have arrived:
-
- if ($check_folders > 0) {
- select(STDERR);
- $| = 1; # Force output of '.' as we look for a good group
- select(STDOUT);
- }
-
- $newsarts_cur = $newsarts;
-
- while ($#stack >= 0) {
- ($_ = $stack[0]) =~ s/\s+//g;
-
- # An item beginning with '+' specifies a folder instead of
- # a news group.
-
- if (/^\+/) {
- $_ = $';
- $group = $_;
- $dir = &relative_to_absolute($_);
- $folder = $_;
- s%/%.%g;
- $cur_context = "$contexts/FOLDER.$_";
- # Bug: +foo.bar will have the same context as +foo/bar.
- $update_cur = 1;
- }
- else {
- $group = $_;
- s%\.%/%g;
- $dir = "$newsarts_cur/$_";
- $folder = $dir;
- $cur_context = "$contexts/$group";
- $update_cur = 0;
- }
-
- # print STDERR "group = \"$group\"\n",
- # "dir = \"$dir\"\n",
- # "folder = \"$folder\"\n",
- # "ctxt = \"$cur_context\"\n",
- # "stack = ", join(' ', @stack), "\n"
- # ;
-
- last if ($check_folders <= 0);
-
- if (! -d $dir) {
- print STDERR "\nno such news group as $group\n";
- shift @stack;
- next;
- }
-
- $ENV{'MHCONTEXT'} = $cur_context;
- $finfo = `folder +$folder`;
- if ($? >> 8) {
- print STDERR "\nfolder change to +$folder failed\n";
- shift @stack;
- next;
- }
- print(STDERR $finfo) if ($debug > 0);
-
- if ($finfo =~ /\s+has\s+no\s+/) {
- # There are no messages in this folder, so ensure that the cur
- # sequence is destroyed and go on to the next folder.
-
- &destroy_cur($dir);
- print STDERR '.';
- $dots++;
- shift @stack;
- next;
- }
-
- if ($finfo =~ /cur=\s*(\d+)/) {
- $cur = $1;
- }
- else {
- # There are messages in here, but there's no cur message apparent,
- # so reset the cur sequence.
-
- &destroy_cur($dir);
- $cur = 0;
- }
-
- if ($finfo =~ /message.*\(\s*(\d+)-\s*(\d+)\s*\)/) {
- $lastm = $2;
-
- if ($cur >= $lastm) {
- # We don't have any new messages in this folder, so go on to
- # the next one. (Bug: we should check for an "unseen" sequence.)
-
- print STDERR '.';
- $dots++;
- shift @stack;
- next;
- }
- else {
- last; # Found a live one.
- }
- }
- } # end while
-
- if ($dots > 0) {
- print STDERR "\n";
- select(STDERR);
- $| = 0;
- select(STDOUT);
- }
- }
-
- # Rewrite the folder stack file:
-
- if ($clear_stack > 0) {
- @stack = ();
- }
-
- if ($push > 0) {
- if (! open(STACK, ">$folder_stack")) {
- print STDERR
- "$prog: can't rewrite folder stack file \"$folder_stack\" - $!\n";
- print "$mhcontext\n" unless ! $print_context;
- exit 1;
- }
- if ( (! print STACK join(' ', @stack)) || ! close(STACK) ) {
- print STDERR
- "$prog: can't write folder stack file \"$folder_stack\" - $!\n";
- print "$mhcontext\n" unless ! $print_context;
- exit 1;
- }
- }
-
- if ($clear_stack > 0) {
- exit 0;
- }
-
- # Tell the user what the state of the folder stack is:
-
- if ($#stack >= 0) {
- $_ = $stack[0];
-
- if ($next <= 0) {
- printf(STDERR "%d news group%s selected; topmost: %s\n",
- $#stack + 1,
- $#stack > 0 ? 's' : '',
- $_);
- }
- else {
- print STDERR "topmost: $_\n";
- }
-
- if (/^\+/) {
- $_ = $';
- s%/%.%g;
- print "$contexts/FOLDER.$_\n";
- }
- else {
- print "$contexts/$_\n";
- }
- }
- else {
- if ($next <= 0) {
- print STDERR "no news groups selected\n";
- }
- print "$mhcontext\n" unless ! $print_context;
- }
-
- exit 0;
- //go.sysin dd *
- made=TRUE
- if [ $made = TRUE ]; then
- /bin/chmod 555 stacknews
- /bin/echo -n ' '; /bin/ls -ld stacknews
- fi
- /bin/echo 'Extracting stacknews.aliases'
- sed 's/^X//' <<'//go.sysin dd *' >stacknews.aliases
- # stacknews.aliases - Stacknews-related csh aliases
- #
- # Usage: source <path>/stacknews.aliases
- #
- # Author: Jerry Sweet <jsweet@ics.uci.edu>
- #
- # $Id: stacknews.aliases,v 1.1 1992/08/20 19:27:23 jsweet Exp $
-
- if (! $?stacknews) then
- set stacknews = "stacknews"
- endif
- alias sninvo 'setenv MHCONTEXT `$stacknews \!*`'
- alias news 'set stacknews = "stacknews" ; sninvo'
- alias fnews 'set stacknews = "stacknews.f" ; sninvo'
- alias g 'setenv MHCONTEXT `$stacknews -next \!*`'
- alias q 'folder -fast last >& /dev/null ; g'
- alias u 'setenv MHCONTEXT `$stacknews -nopush \!*`'
- alias z '$stacknews -clear \!*; unsetenv MHCONTEXT'
- alias nglist '$stacknews -list \!*'
- //go.sysin dd *
- made=TRUE
- if [ $made = TRUE ]; then
- /bin/chmod 400 stacknews.aliases
- /bin/echo -n ' '; /bin/ls -ld stacknews.aliases
- fi
- /bin/echo 'Extracting stacknews.l'
- sed 's/^X//' <<'//go.sysin dd *' >stacknews.l
- X.\" $Header: /q2/uh/jsweet/src/mh-front/RCS/stacknews.l,v 1.3 1992/06/11 18:41:48 jsweet Exp $
- X.\"
- X.TH STACKNEWS 1 STACKNEWS
- X.UC 6
- X.SH NAME
- stacknews \- USENET news + MH utility
-
- X.SH SYNOPSIS
- setenv MHCONTEXT `stacknews
- \%[\-(no)check]
- \%[\-(no)clear]
- \%[\-(no)debug]
- \%[\-(no)list]
- \%[\-(no)next]
- \%[\-(no)push]
- \%[\-(no)rigor]
- \%[newsgroup ...]
- \%[+folder ...]`
-
- X.SH DESCRIPTION
-
- Stacknews is a utility program for reading USENET news via MH.
- Stacknews works in conjunction with the c-shell and MH to permit you
- to read news at the shell level, without resorting to news readers such
- as nn or rn.
-
- Stacknews is not itself the command that you invoke to read news;
- other commands do that on your behalf, such as "news", "g", "z", and
- "nglist".
- These commands are c-shell aliases that invoke stacknews with
- the appropriate options to perform different operations.
-
- To use stacknews, you must add some alias definitions to your .cshrc
- file. The required code is described in the INSTALLATION section of
- this man page.
-
- More complete descriptions of the various stacknews-related news
- reading commands are:
- X.in +1i
-
- X.ti -.5i
- news
- X.br
- Creates the initial conditions necessary to begin reading news at the
- shell level: the list of news group folders is built, and the first
- folder is selected.
-
- X.ti -.5i
- g
- X.br
- Goes to the next news group in the list.
-
- X.ti -.5i
- q
- X.br
- Quits a news group and goes to the next one.
- This is similar to the "g" command, but before going to the next news group,
- the "q" command sets the last message to be current.
-
- X.ti -.5i
- u
- X.br
- Updates the current shell so that news reading can pick up where it
- left off.
- This is useful if you logged out before reading all your news,
- or if you switched windows.
-
- X.ti -.5i
- z
- X.br
- Clears the list of news groups and permits you to stop reading news
- altogether.
-
- X.ti -.5i
- nglist
- X.br
- Lists the news groups waiting to be read.
-
- X.in -1i
-
- Stacknews allows folders to be used interchangeably with news groups.
- This facility is of particular use with automatically updated folders,
- e.g. those folders to which incoming e-mail is automatically redirected
- via the rcvstore(1) program.
-
-
- X.SH INSTALLATION
-
- Stacknews requires certain semi-specialized conditions to pertain:
- X.PP
- X.in +.5i
- 1) Stacknews can be used only on the primary news machine, unless the news
- spool directory (typically /usr/spool/news) is NFS-mounted.
- Stacknews does not require that the news spool directory be present
- if you read NO news groups, and specify only your own folders.
- X.PP
- X.in +.5i
- 2) Stacknews is written in perl, and therefore perl 4.0 or later must be
- installed on your system.
- X.PP
- X.in +.5i
- 3) Stacknews uses certain specialized features of MH, and therefore
- MH 6.6 or later must be installed on your system.
- X.in -.5i
- X.PP
-
- If you aren't sure whether these conditions pertain,
- take these steps to find out:
- X.PP
- 1. Type this command:
- X.in +.5i
- ls /usr/spool/news
- X.in -.5i
- X.PP
- If you don't see anything in that directory, or if it doesn't exist,
- then you can't use stacknews to read USENET news.
- If the news spool directory is something other than /usr/spool/news,
- then you may specify the alternative news spool directory in
- the stacknews-arts component in your .mh_profile (see the MH PROFILE
- COMPONENTS section in this document).
- If you don't have a news spool directory on your machine,
- you can still use stacknews to read folders.
- X.PP
- 2. Type this command:
- X.in +.5i
- perl -v
- X.in -.5i
- X.PP
- If the version number displayed isn't 4.0 or later, then you might
- have problems running stacknews.
- You can give it a try, but it isn't guaranteed to work.
- X.PP
- 3. Type this command:
- X.in +.5i
- folder -help
- X.in -.5i
- X.PP
- If the version number of MH displayed at the bottom of the output of
- the "folder" command isn't 6.6 or greater,
- then the version of MH on your system may lack the features necessary
- to support stacknews.
- You can give it a try, but it isn't guaranteed to work.
-
- The stacknews program itself may be installed anywhere.
- The directory /usr/local/bin is not a bad choice.
- If you don't have access to that directory, then choose some
- directory that occurs in your PATH, e.g. ~/bin.
-
- Add these lines to the .cshrc file in your home directory:
- X.in +.5i
- # Define some stacknews-related aliases
- X.br
-
- X.br
- if\ (!\ $?stacknews)\ then
- X.br
- \ \ set\ stacknews\ =\ "stacknews"
- X.br
- endif
- X.br
- alias\ sninvo\ 'setenv\ MHCONTEXT\ `$stacknews\ \!*`'
- X.br
- alias\ news\ 'set\ stacknews\ =\ "stacknews"\ ;\ sninvo'
- X.br
- alias\ g\ 'setenv\ MHCONTEXT\ `$stacknews\ \-next\ \!*`'
- X.br
- alias\ q\ 'folder\ \-fast\ last\ >\ /dev/null\ ;\ g'
- X.br
- alias\ u\ 'setenv\ MHCONTEXT\ `$stacknews\ \-nopush\ \!*`'
- X.br
- alias\ z\ '$stacknews\ \-clear\ \!*;\ unsetenv\ MHCONTEXT'
- X.br
- alias\ nglist\ '$stacknews\ \-list\ \!*'
- X.in -.5i
-
- If you don't already have a .cshrc file in your home directory, then
- you must create a .cshrc file to contain the alias definitions above.
-
- If any of the stacknews aliases described above conflict with
- existing aliases,
- then you'll have to select new names either for the stacknews aliases or for
- the previously existing aliases.
-
- After you've modified your .cshrc file, at the c-shell prompt
- type these commands:
- X.PP
- X.in +.5i
- source\ ~/.cshrc
- X.br
- rehash
- X.in -.5i
- X.PP
-
- Place into the .news\-defaults file in your home directory the following
- lines:
- X.PP
- X.in +.5i
- news.announce.newusers
- X.br
- news.announce.important
- X.br
- news.answers
- X.br
- comp.lang.perl
- X.br
- comp.mail.mh
- X.in -.5i
- X.PP
- Feel free to add or to delete news groups as needed.
-
- If you have arranged for some of your folders to be updated automatically
- via rcvstore(1), you may place folder specifications as well as news groups
- into the .news\-defaults file, e.g.:
- X.in +.5i
- +lists/mh-mime
- X.br
- +lists/com-priv
- X.in -.5i
- X.PP
-
- To find out what news groups are available, type this command:
- X.in +.5i
- more ~news/newsgroups
- X.in -.5i
- X.PP
- Other commands may be necessary to find out what news groups are
- available on your system.
-
-
- X.SH TUTORIAL
-
- When you have performed the necessary setups described in the previous
- section, type this command:
- X.in +.5i
- news
- X.in -.5i
- X.PP
-
- You should see something like this:
- X.in +.5i
- 5 news groups selected; topmost: news.announce.newusers
- X.br
- %
- X.in -.5i
- X.PP
-
- Your current folder becomes the news group "news.announce.newusers",
- which is the first news group listed in your ~/.news\-defaults file.
-
- To read the next new message, type
- X.in +.5i
- next
- X.in -.5i
- X.PP
- To scan the available messages, type
- X.in +.5i
- scan next-last
- X.in -.5i
- X.PP
-
- To move on to the next news group, type
- X.in +.5i
- g
- X.in -.5i
- X.PP
- If you see dots (".") printed, that means that stacknews is discarding
- news groups in which no new articles have appeared.
-
- To select a completely different news group to read next, e.g. "alt.sex",
- type
- X.in +.5i
- news alt.sex
- X.in -.5i
- X.PP
- (The aforementioned news group is not available everywhere, so substitute
- some available news group.)
-
- To return to a news group in which you might have read the last
- message already, e.g. "news.announce.newusers", type
- X.in +.5i
- news -nocheck news.newusers
- X.in -.5i
- X.PP
-
- To see the list of news groups to be read, type
- X.in +.5i
- nglist
- X.in -.5i
- X.PP
-
- If you change windows, or log out and log back in again later, and
- you wish to resume reading news, then type
- X.in +.5i
- u
- X.in -.5i
- X.PP
-
- To stop reading news, type
- X.in +.5i
- z
- X.in -.5i
- X.PP
-
-
- X.SH OPTIONS
-
- Stacknews is designed to be invoked via c-shell aliases. Therefore,
- you should not find it desirable or necessary to invoke stacknews
- directly. Furthermore, the various options to stacknews are not
- guaranteed to interoperate, except as they are used in the c-shell
- aliases listed in the INSTALLATION section.
-
- The default settings are:
- X.in +.5i
- \-check \-noclear \-nodebug \-nonext \-push \-rigor
- X.in +.5i
- X.PP
-
- Any news groups specified on the command line are pushed onto the
- news group stack.
- If no groups are specified, then all default groups are
- pushed onto the stack (typically from ~/.news-defaults).
-
- Mutually exclusive options: \-clear, \-list, \-next, \-push.
-
-
- The options are:
-
- X.in +1i
-
- X.ti -.5i
- -check
- X.ti -.5i
- -nocheck
- X.br
- By default, when stacknews selects a new news group,
- it is simply discarded if it has no new articles.
- A group is considered to have new articles if there are articles following
- the "cur" message sequence.
- The -nocheck option prevents the check for new articles; a group is
- pushed unconditionally.
- The -check option corresponds to the default behavior; it negates
- a -nocheck option if -nocheck is present.
-
- X.ti -.5i
- -clear
- X.ti -.5i
- -noclear
- X.br
- The -clear option causes stacknews to clear the news group stack.
- The -noclear option simply negates the -clear option when the -clear
- option is present.
-
- X.ti -.5i
- -debug
- X.ti -.5i
- -nodebug
- X.br
- The -debug option causes a limited amount of information to be printed
- on STDERR that is not normally displayed.
-
- X.ti -.5i
- -list
- X.ti -.5i
- -nolist
- X.br
- The -list option causes the state of the news group stack to be printed.
- The -nolist option negates the -list option when the -list option is
- present.
-
- X.ti -.5i
- -next
- X.ti -.5i
- -nonext
- X.br
- The -next option pops the news group stack and causes the next news
- group that contains new articles to be selected.
- If the -nocheck option is present, the check for new articles is suppressed,
- and the next news group in the news group stack is selected unconditionally.
- The -nonext option negates the -next option when the -next option is
- present.
-
- X.ti -.5i
- -push
- X.ti -.5i
- -nopush
- X.br
- The -push option pushes a new news group onto the top of the news group
- stack.
- The -nopush option in a sense performs no operation,
- except that it causes the topmost news group to be selected.
-
- X.ti -.5i
- -rigor
- X.ti -.5i
- -norigor
- X.br
- By default, stacknews functions as a normal MH program does, i.e. it
- checks the environment for relevant information and then checks
- the user's MH profile file (typically .mh_profile in the home directory).
- The -norigor option causes the MH profile to be ignored; only the
- environment is considered.
-
-
- X.in -1i
-
- X.SH DESIGN RATIONALE
-
- Most USENET news implementations organize news groups as directories.
- To translate a USENET news group into a directory path, substitute
- slashes ("/") for dots ("."), and prepend the path of the news spool
- directory, typically /usr/spool/news.
-
- MH already uses directories relative to a pre-determined path for folders,
- e.g. the notation "+inbox" refers to the directory "$HOME/Mail/inbox".
- Fortunately, MH can also use an absolute path in a folder specification.
- A USENET news group is treated by stacknews as a folder with an
- absolute path, e.g. "+/usr/spool/news/comp/lang/perl".
-
- For most users, a USENET news group will be treated as a read-only folder.
- Because of the way MH interacts with read-only folders,
- certain MH features, such as message annotation (anno), digest
- bursting (burst), and refiling (refile) should not be expected to
- work properly when read-only folders are selected,
- although some work-arounds are possible.
- The majority of MH features are available,
- such as pick(1), forw(1), show(1), etc.
-
- Because MH slows down considerably when a large number of private
- sequences accumulates in the default context file,
- a separate context is kept for each news group.
- The prevailing context is specified by setting the environment
- variable MHCONTEXT, which is recognized by all MH programs.
-
- C-shell aliases are employed to implement the various stacknews-related
- commands.
- Using c-shell aliases permits the output of stacknews to be used to set
- the MHCONTEXT variable.
-
- UNIX presently does not permit environment information to be shared among
- different "peer" processes.
- To overcome this problem, the "u" command is provided to
- "update" the MHCONTEXT variable among different interactive shells,
- e.g. login sessions and windows.
-
- By invoking the "news" command, you build a stack of news groups or
- folders that you want to read in sequence.
- A default list of news groups to be read is taken from a file that you
- create, ~/.news-defaults.
- Progression from news group to news group is accomplished by invoking
- "g", which is a command to "pop" succeeding folders off the top of the list.
-
- Because the default MH folder stack, as used by "folder\ \-push",
- is kept in the context file,
- and because the context changes according to the setting of the
- MHCONTEXT variable,
- stacknews maintains an entirely separate folder stack.
-
-
- X.SH ENVIRONMENT
-
- Stacknews uses many different environment variables, some in common
- with MH.
- They are:
- X.in +1i
- X.ti -.5i
- HOME
- X.br
- Path of home directory.
-
- X.ti -.5i
- MH
- X.br
- Path of MH profile file. Used by all MH programs.
- Default: ~/.mh_profile.
-
- X.ti -.5i
- MHCONTEXT
- X.br
- Path of current MH context file. Used by all MH programs.
- Default: ~/Mail/context.
-
- X.ti -.5i
- NEWSARTS
- X.br
- Path of top directory containing news articles.
- Default: /usr/spool/news.
-
- X.ti -.5i
- NEWSCONTEXTS
- X.br
- Path of directory containing folder contexts
- Default: ~/.news-contexts.
-
- X.ti -.5i
- NEWSGROUPS
- X.br
- List of colon-separated news groups to read.
- Defaults: as specified in ~/.news-defaults.
-
- X.in -1i
-
- X.SH MH PROFILE COMPONENTS
-
- Stacknews reads the MH profile unless the -norigor option is specified.
-
- The MH environment variable is consulted to determine which MH profile
- file to read.
- If the MH environment variable is not defined, then the ~/.mh_profile
- file is read.
-
- The MH profile components relevant to stacknews are:
-
- X.in +1i
-
- X.ti -.5i
- context:
- X.br
- Path of MH context file.
- Default: as specified in the MHCONTEXT environment variable, or
- ~/Mail/context.
-
- X.ti -.5i
- Path:
- X.br
- Path of MH directory.
- Default: ~/Mail.
-
- X.ti -.5i
- stacknews:
- X.br
- Stacknews options.
- Defaults: \-check \-noclear \-nodebug \-nonext \-push \-rigor.
-
- X.ti -.5i
- stacknews-arts:
- X.br
- Path of top directory containing news articles.
- Default: As specified by the NEWSARTS environment variable or
- X/usr/spool/news.
-
- X.ti -.5i
- stacknews-contexts:
- X.br
- Path of directory containing folder contexts.
- Default: As specified by the NEWSCONTEXTS environment variable or
- ~/.news-contexts.
-
- X.ti -.5i
- stacknews-defaults:
- X.br
- Path of file containing list of news groups.
- Default: ~/.news-defaults.
-
- X.ti -.5i
- stacknews-groups:
- X.br
- List of comma-separated news groups to read.
- Defaults: as specified in the NEWSGROUPS environment variable,
- or as specified in ~/.news-defaults.
-
- X.in -1i
-
- Where "stacknews" is specified in a .mh_profile component,
- stacknews looks for its invocation name.
- The relevant MH profile components are therefore normally
- named stacknews-defaults, stacknews-groups, and stacknews-arts.
- However, if stacknews were invoked as "stn", then stacknews would
- instead look for components named stn-defaults, stn-groups,
- and stn-arts.
- The variable prefix for components permits different invocations
- of stacknews to use different sets of options.
-
-
- X.SH FILES
-
- X.in +1i
-
- X.ti -.5i
- $HOME/.mh_profile
- X.br
- Default MH profile.
-
- X.ti -.5i
- $HOME/.news-contexts
- X.br
- Default news folder contexts directory.
- All of the context files to which MHCONTEXT refers are kept here.
-
- X.ti -.5i
- $HOME/.news-contexts/Stack
- X.br
- News folder stack.
-
- X.ti -.5i
- $HOME/.news-contexts/FOLDER.*
- X.br
- Context files for folders.
- For example, "FOLDER.lists.mh-mime" is the context file for the
- folder "+lists/mh-mime".
- (This representation has a problem in that dots in folder names
- may result in context file name collisions, e.g. in the case
- of "+lists.mh-mime".)
-
- X.ti -.5i
- $HOME/.news-contexts/[a-z]*
- X.br
- Context files for news groups.
-
- X.ti -.5i
- $HOME/.news-defaults
- X.br
- List of default news groups.
-
- X.ti -.5i
- $HOME/Mail
- X.br
- Default MH directory.
-
- X.ti -.5i
- $HOME/Mail/context
- X.br
- Default MH context file.
-
- X.in -1i
-
- X.SH AUTHOR
-
- Jerry Sweet <jsweet@ics.uci.edu>
-
- X.SH MISCELLANEOUS INFORMATION
-
- This man page describes version 1.5 of stacknews.
-
- X.SH BUGS
-
- It's easy to lose your way if you use "folder\ \-push".
-
- Stacknews doesn't address some of the problems posed by using MH to
- handle news groups, as well some general problems posed by
- read-only folders.
- For example, the problem of posting news versus
- sending e-mail needs to be addressed at some level between the UA and
- the MTA.
- Another problem is that of copying versus linking messages.
- Some partial work-arounds have been devised by the author, but these
- are not yet in releasable form.
- Some tweaks to MH itself (e.g. in the "post" program) might be
- desirable the better to accommodate news and read-only folders.
-
- X.SH SEE ALSO
- X.IR csh (1),
- X.IR mh(1)
- //go.sysin dd *
- made=TRUE
- if [ $made = TRUE ]; then
- /bin/chmod 444 stacknews.l
- /bin/echo -n ' '; /bin/ls -ld stacknews.l
- fi
-